<?php

/**
 * InputElninoLanina form base class.
 *
 * @method InputElninoLanina getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInputElninoLaninaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IELNINO_ID'         => new sfWidgetFormInputHidden(),
      'SISSUE_NO'          => new sfWidgetFormInputText(),
      'DTISSUE_TIME'       => new sfWidgetFormDateTime(),
      'DTSTARTTIME'        => new sfWidgetFormDateTime(),
      'DTENDTIME'          => new sfWidgetFormDateTime(),
      'SGENERAL_SITUATION' => new sfWidgetFormTextarea(),
      'SFORECAST'          => new sfWidgetFormTextarea(),
      'SEFFECT'            => new sfWidgetFormTextarea(),
      'SOBSERVATION'       => new sfWidgetFormTextarea(),
      'SREMARK'            => new sfWidgetFormTextarea(),
      'SIMAGE_FILE'        => new sfWidgetFormInputText(),
      'IUSER_ID'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IELNINO_ID'         => new sfValidatorChoice(array('choices' => array($this->getObject()->getIelninoId()), 'empty_value' => $this->getObject()->getIelninoId(), 'required' => false)),
      'SISSUE_NO'          => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'DTISSUE_TIME'       => new sfValidatorDateTime(array('required' => false)),
      'DTSTARTTIME'        => new sfValidatorDateTime(array('required' => false)),
      'DTENDTIME'          => new sfValidatorDateTime(array('required' => false)),
      'SGENERAL_SITUATION' => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SFORECAST'          => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SEFFECT'            => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SOBSERVATION'       => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SREMARK'            => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SIMAGE_FILE'        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'IUSER_ID'           => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input_elnino_lanina[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InputElninoLanina';
  }


}
